﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Text.RegularExpressions;

namespace WcfServiceLibrarySubstringCount.SOAP
{
    public class ServiceSubstringCount : IServiceSubstringCount
    {
        public int GetCount(string pattern, string text)
        {
            Regex regex = new Regex(pattern);
            MatchCollection collection = regex.Matches(text);
            int count = collection.Count;
            return count;
        }
    }
}
